Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Upgrade jsc-android to 250230.2.1 #31304

Closed
wants to merge 2 commits into from
Closed

Conversation

Kudo
Copy link
Contributor

@Kudo Kudo commented Apr 6, 2021

Summary

Upgrade jsc-android to latest stable version. Hopefully this should finally fix #25494.
Before Hermes totally replaced JSC, it should be worth to have this and make JSC stable

Changelog

[Android] [Changed] - Upgrade jsc-android to 250230.2.1

Test Plan

Launch app with new jsc-android and see everything works fine.

@Kudo Kudo requested a review from hramos as a code owner April 6, 2021 01:02
@facebook-github-bot facebook-github-bot added CLA Signed This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed. Contributor A React Native contributor. labels Apr 6, 2021
@pull-bot
Copy link

pull-bot commented Apr 6, 2021

Warnings
⚠️ 🔒 package.json - Changes were made to package.json. This will require a manual import by a Facebook employee.

Generated by 🚫 dangerJS against 1d65c27

@analysis-bot
Copy link

analysis-bot commented Apr 6, 2021

Platform Engine Arch Size (bytes) Diff
ios - universal n/a --

Base commit: ae07c53

@analysis-bot
Copy link

analysis-bot commented Apr 14, 2021

Platform Engine Arch Size (bytes) Diff
android hermes arm64-v8a 8,853,324 +0
android hermes armeabi-v7a 8,374,673 +0
android hermes x86 9,310,269 +0
android hermes x86_64 9,253,273 +0
android jsc arm64-v8a 10,621,916 +37,478
android jsc armeabi-v7a 9,524,626 -564,269
android jsc x86 10,669,050 +66,171
android jsc x86_64 11,251,933 +65,785

Base commit: ae07c53

@Kudo
Copy link
Contributor Author

Kudo commented Apr 16, 2021

@hramos The CI is passed now for this PR. Could you please take a look? Hopefully this could be landed and have a more stabler JSC in the future.

@Cnilton
Copy link

Cnilton commented Apr 27, 2021

@hramos, please review this PR, @Kudo thanks for the contribution to fix this

@mganandraj
Copy link
Contributor

mganandraj commented May 14, 2021

Here I'm pasting the outcome from our quick investigation over this PR:

@Kudo Please review ..

A quick evaluation of this PR which is upgrading the JavaScriptCore binaries used by react-native on Android platform,

The PR is upgrading JSC binaries from revision 245459 to 250230. These numbers are the SVN revision numbers in Webkit repo (svn info "${URL}" | sed -n 's/^Last Changed Rev: //p') akin to the commit ids in Git repos.

These binaries are generated based on the WebKitGtk sources and the build scripts are stored in this repo :react-native-community/jsc-android-buildscripts: Script for building JavaScriptCore for Android (for React Native but not only) (github.com)

The current JSC package consumed in react-native

The last JSC upgrade in react-native was through this commit: https://github.com/facebook/react-native/commit/58d87940a1a995f0faf1270c0da435b44015575f on Jul 1, 2019.

It was also built by Kudo

This was the commit description,

Upgrade jsc-android to r245459 and fix crash on Samsung S7 Edge (#25426)

Summary:

Upgrade bundled jsc-android that should fix the native JSC crash addressed for #24261.

Major changes after r241213 are:

1. Disable DFG JIT.

2. Upgrade WebKitGTK to 2.24.2, this version includes the [new bytecode format enhancement](https://webkit.org/blog/9329/a-new-bytecode-format-for-javascriptcore/).

3. Workaround LLVM \_\_clear\_cache issue which may have some problems on ARM Cortex A-53.

For details, please refer to the PRs in https://github.com/react-native-community/jsc-android-buildscripts.

In #24261, there were many experimented JSC deliveries and thank to people in RN community helping me verify the final version which solve the crash issues.

Even though the above commit description suggested that the JIT was being turned off, by looking at the changes that went into the JSC build scripts, the JIT was turned back on based on the feedbacks on adverse impact on performance,

react-native-community/jsc-android-buildscripts@abdce96

commited on Jun 25, 2019

Here is a summary on the state of JSC package at present,

  1. Based in WebKitGtk release v2.24.2 (SVN revision 245459) released on 05/17/2019
  2. ICU 58.1
  3. Based on Android ndk version r17c

Latest PR

By looking at the changes went into the build scripts, the following are the enhancements in the JSC binaries with the latest PR,

  1. Based on WebKitGTK 2.26.1 (SVN revision 250230) dated on 09/23/2019
  2. Upgraded ICU from v58.1 to v64.2
  3. Built with Android NDK r19c
  4. One key crash fix is included,

react-native-community/jsc-android-buildscripts@57a2aa0

Summary

I'd summarize my thoughts below,

  1. he new package is also based on a 1½ year old version of Webkit source and is only 4 months ahead of the current one. Hence I don’t expect the new binaries to be much different, and any important security fixes to be included.
  2. The crash fix mentioned above seems to be one that community is looking forward to. The fix is not yet tested and verified to fix the crash though as far as I understood. But the crash seems to be happening because of synchronization issues between GC and interpreter access to bytecode pages and the fix is addressing it, hence it will likely fix the crash.
  3. ICU bump from 58.* to 64.* can mean a lot for products which consumes JSC with Intl enabled.

@facebook-github-bot
Copy link
Contributor

@yungsters has imported this pull request. If you are a Facebook employee, you can view this diff on Phabricator.

@facebook-github-bot
Copy link
Contributor

@yungsters merged this pull request in 341f061.

@facebook-github-bot facebook-github-bot added the Merged This PR has been merged. label May 24, 2021
@Kudo
Copy link
Contributor Author

Kudo commented May 26, 2021

Thanks @mganandraj for the briefly description which is correct.
and thanks @yungsters for getting this landed.

@yungsters
Copy link
Contributor

Sure thing. Thanks right back at you, @Kudo! And yes, much appreciation to @mganandraj for the analysis that helped me do a lot of the legwork to gain the context for merging this.

Titozzz pushed a commit to Titozzz/react-native that referenced this pull request Jun 7, 2021
Summary:
Upgrade jsc-android to latest stable version. Hopefully this should finally fix facebook#25494.
Before Hermes totally replaced JSC, it should be worth to have this and make JSC stable

## Changelog

[Android] [Changed] - Upgrade jsc-android to 250230.2.1

Pull Request resolved: facebook#31304

Test Plan: Launch app with new jsc-android and see everything works fine.

Reviewed By: TheSavior

Differential Revision: D28630503

Pulled By: yungsters

fbshipit-source-id: 84510f91c81d4aaefe265d5492677ad6ff10e0fe
Titozzz pushed a commit to Titozzz/react-native that referenced this pull request Jun 7, 2021
Summary:
Upgrade jsc-android to latest stable version. Hopefully this should finally fix facebook#25494.
Before Hermes totally replaced JSC, it should be worth to have this and make JSC stable

## Changelog

[Android] [Changed] - Upgrade jsc-android to 250230.2.1

Pull Request resolved: facebook#31304

Test Plan: Launch app with new jsc-android and see everything works fine.

Reviewed By: TheSavior

Differential Revision: D28630503

Pulled By: yungsters

fbshipit-source-id: 84510f91c81d4aaefe265d5492677ad6ff10e0fe
tido64 pushed a commit that referenced this pull request Jun 8, 2021
Summary:
Upgrade jsc-android to latest stable version. Hopefully this should finally fix #25494.
Before Hermes totally replaced JSC, it should be worth to have this and make JSC stable

## Changelog

[Android] [Changed] - Upgrade jsc-android to 250230.2.1

Pull Request resolved: #31304

Test Plan: Launch app with new jsc-android and see everything works fine.

Reviewed By: TheSavior

Differential Revision: D28630503

Pulled By: yungsters

fbshipit-source-id: 84510f91c81d4aaefe265d5492677ad6ff10e0fe
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
CLA Signed This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed. Contributor A React Native contributor. Merged This PR has been merged. Needs: React Native Team Attention
Projects
None yet
Development

Successfully merging this pull request may close these issues.

signal 11 (SIGSEGV), code 1 (SEGV_MAPERR) libjsc.so still occuring on Caterpillar S41 (Android 8.0)
8 participants